// Copyright 2007 Google Inc.  All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.enterprise.connector.afyd;

import com.google.enterprise.connector.spi.Connector;
import com.google.enterprise.connector.spi.Session;
import com.google.enterprise.connector.spi.AuthenticationManager;
import com.google.enterprise.connector.spi.AuthorizationManager;
import com.google.enterprise.connector.spi.TraversalManager;
import com.google.enterprise.connector.spi.RepositoryException;

import junit.framework.Assert;
import junit.framework.TestCase;

/**
 * This class is a test case that verifies several properties of the 
 * AfydConnector implementation, namely:
 * (1) The connector implements the interfaces required by the SPI
 * 
 * @author amsmith@google.com (Adam Smith)
 */
public class AfydConnectorTest extends TestCase {
  
  public void testConnectorImplementsRequiredInterfaces() {
    try {
      Connector connector = new AfydConnector(null, "ignored.properties", null);
      Session session = connector.login();
      AuthenticationManager authnManager = session.getAuthenticationManager();
      AuthorizationManager authzManager = session.getAuthorizationManager();
      TraversalManager traversalManager = session.getTraversalManager();
    } catch (ClassCastException cce) {
      Assert.fail(cce.toString());
    } catch (RepositoryException re) {
      // this is OK to throw
    }
  }

}

